package cn.pfz.domain;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * @Author: 普发忠
 * @Date: 2021/10/09/15:34
 * 攻略分类：从属于某个目的地
 */
@Data
@TableName("strategy_catalog")
public class StrategyCatalog extends BaseDomain  {

    
    private String name;
    private String destName;
    private Long destId;
    private Integer state=STATE_NORMAL;
    private Integer seq;

    @TableField(exist = false)
    private List<Strategy> strategies=new ArrayList<>();
    
    public String getStateDisplay(){
        return state==STATE_NORMAL ? "正常":"异常";
    }
    public String getJsonString(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("id",super.getId());
        map.put("name",this.getName());
        map.put("destId",this.getDestId());
        map.put("seq",this.getSeq());
        map.put("state",this.getState());
        return JSON.toJSONString(map);
    }
}
